home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume23 / trn / part14 < prev    next >
Encoding:
Text File  |  1991-08-22  |  44.5 KB  |  1,549 lines

  1. This is a new archive version of TRN at patchlevel 3.
  2. The original posting took up Volume23, issues 60 to 73, with
  3. various problems.  These files replace those issues.
  4.  
  5. #! /bin/sh
  6. # This is a shell archive.  Remove anything before this line, then feed it
  7. # into a shell via "sh file" or similar.  To overwrite existing files,
  8. # type "sh file -c".
  9. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  10. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  11. # Contents:  EXTERN.h INTERN.h Wishlist addng.h art.h artsrch.h
  12. #   artstate.h backpage.h cheat.h final.h help.h init.h intrp.h
  13. #   kfile.h last.c last.h makedir.SH makekit mt-lint.h newsnews.SH
  14. #   ng.h ngdata.h ngsrch.h ngstuff.h norm.saver.SH only.h rcln.h
  15. #   rcstuff.h respond.h rn.h search.h sw.h unipatch.c util.h
  16. # Wrapped by rsalz@litchi.bbn.com on Fri Aug 23 16:39:05 1991
  17. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  18. echo If this archive is complete, you will see the following message:
  19. echo '          "shar: End of archive 14 (of 14)."'
  20. if test -f 'EXTERN.h' -a "${1}" != "-c" ; then 
  21.   echo shar: Will not clobber existing file \"'EXTERN.h'\"
  22. else
  23.   echo shar: Extracting \"'EXTERN.h'\" \(245 characters\)
  24.   sed "s/^X//" >'EXTERN.h' <<'END_OF_FILE'
  25. X/* $Header: EXTERN.h,v 4.3 85/05/01 11:58:01 lwall Exp $
  26. X *
  27. X * $Log:    EXTERN.h,v $
  28. X * Revision 4.3  85/05/01  11:58:01  lwall
  29. X * Baseline for release with 4.3bsd.
  30. X * 
  31. X */
  32. X
  33. X#undef EXT
  34. X#define EXT extern
  35. X
  36. X#undef INIT
  37. X#define INIT(x)
  38. X
  39. X#undef DOINIT
  40. END_OF_FILE
  41.   if test 245 -ne `wc -c <'EXTERN.h'`; then
  42.     echo shar: \"'EXTERN.h'\" unpacked with wrong size!
  43.   fi
  44.   # end of 'EXTERN.h'
  45. fi
  46. if test -f 'INTERN.h' -a "${1}" != "-c" ; then 
  47.   echo shar: Will not clobber existing file \"'INTERN.h'\"
  48. else
  49.   echo shar: Extracting \"'INTERN.h'\" \(243 characters\)
  50.   sed "s/^X//" >'INTERN.h' <<'END_OF_FILE'
  51. X/* $Header: INTERN.h,v 4.3 85/05/01 11:33:16 lwall Exp $
  52. X *
  53. X * $Log:    INTERN.h,v $
  54. X * Revision 4.3  85/05/01  11:33:16  lwall
  55. X * Baseline for release with 4.3bsd.
  56. X * 
  57. X */
  58. X
  59. X#undef EXT
  60. X#define EXT
  61. X
  62. X#undef INIT
  63. X#define INIT(x) = x
  64. X
  65. X#define DOINIT
  66. END_OF_FILE
  67.   if test 243 -ne `wc -c <'INTERN.h'`; then
  68.     echo shar: \"'INTERN.h'\" unpacked with wrong size!
  69.   fi
  70.   # end of 'INTERN.h'
  71. fi
  72. if test -f 'Wishlist' -a "${1}" != "-c" ; then 
  73.   echo shar: Will not clobber existing file \"'Wishlist'\"
  74. else
  75.   echo shar: Extracting \"'Wishlist'\" \(1595 characters\)
  76.   sed "s/^X//" >'Wishlist' <<'END_OF_FILE'
  77. XGeneralized article set manipulation
  78. X    Interface to subject listing.
  79. X    Recursive newsgroup visitation.
  80. XVirtual article abstract type to allow the following:
  81. X    Personalized header munging via % subs.
  82. X    Undigestification.
  83. X    Personal archive perusal.
  84. X    Mail handling.
  85. XParent command (waiting for ARTFILE interface and recursive newsgroups).
  86. XMerge Pnews and postnews.
  87. XVnews duplicate suppression algorithm for sites that can't do Xref patch.
  88. XDynamic allocation of stuff currently restricted by MAXRCLINE.
  89. X    (And pull parallel arrays into array of structs).
  90. XSeparation of .newsrc functions and newsgroup functions to separate processes
  91. X    communicating via pipes (to make fit on non-separate-I-and-D pdp11,
  92. X    or unreasonable facsimiles thereof).
  93. XFaster!!!
  94. XSmaller!!!
  95. XMore general!!!
  96. XPerfect?
  97. X----------
  98. X            Better NNTP Support
  99. X
  100. XThe current NNTP support requires a duplicate database be maintained on each
  101. Xclient machine.  Currently, this requires each client to run the NNTP version
  102. Xof mthreads to access all the articles headers to create the local copy of the
  103. Xthread database.  There are a number of ways this could be improved:
  104. X
  105. X   o    Create the database on the server host and distribute the finished
  106. X    thread files to all the client hosts at regular intervals using ftp,
  107. X    mail, uucp, etc.
  108. X
  109. X   o    Write an adjunct to NNTP that would serve to distribute thread data.
  110. X
  111. X   o    Cajole the NNTP people to include a command to distribe an authorized
  112. X    list of files other than news articles (e.g. thread files).
  113. X
  114. X   o    Eliminate the need for a thread database.
  115. X
  116. XAll these options are left as an exercise for the reader.
  117. END_OF_FILE
  118.   if test 1595 -ne `wc -c <'Wishlist'`; then
  119.     echo shar: \"'Wishlist'\" unpacked with wrong size!
  120.   fi
  121.   # end of 'Wishlist'
  122. fi
  123. if test -f 'addng.h' -a "${1}" != "-c" ; then 
  124.   echo shar: Will not clobber existing file \"'addng.h'\"
  125. else
  126.   echo shar: Extracting \"'addng.h'\" \(424 characters\)
  127.   sed "s/^X//" >'addng.h' <<'END_OF_FILE'
  128. X/* $Header: addng.h,v 4.3.3.1 91/01/16 02:20:45 davison Trn $
  129. X *
  130. X * $Log:    addng.h,v $
  131. X * Revision 4.3.3.1  91/01/16  02:20:45  davison
  132. X * Added optional prototyping.
  133. X * 
  134. X * Revision 4.3  85/05/01  11:34:48  lwall
  135. X * Baseline for release with 4.3bsd.
  136. X * 
  137. X */
  138. X
  139. Xvoid    addng_init ANSI((void));
  140. X#ifdef FINDNEWNG
  141. X    bool    newlist ANSI((bool,bool));
  142. X    long    birthof ANSI((char *,ART_NUM));
  143. X    bool    scanactive ANSI((void));
  144. X#endif
  145. END_OF_FILE
  146.   if test 424 -ne `wc -c <'addng.h'`; then
  147.     echo shar: \"'addng.h'\" unpacked with wrong size!
  148.   fi
  149.   # end of 'addng.h'
  150. fi
  151. if test -f 'art.h' -a "${1}" != "-c" ; then 
  152.   echo shar: Will not clobber existing file \"'art.h'\"
  153. else
  154.   echo shar: Extracting \"'art.h'\" \(481 characters\)
  155.   sed "s/^X//" >'art.h' <<'END_OF_FILE'
  156. X/* $Header: art.h,v 4.3.3.1 91/01/16 02:20:48 davison Trn $
  157. X *
  158. X * $Log:    art.h,v $
  159. X * Revision 4.3.3.1  91/01/16  02:20:48  davison
  160. X * Added optional prototyping.
  161. X * 
  162. X * Revision 4.3  85/05/01  11:35:29  lwall
  163. X * Baseline for release with 4.3bsd.
  164. X * 
  165. X */
  166. X
  167. X/* do_article() return values */
  168. X
  169. X#define DA_NORM 0
  170. X#define DA_RAISE 1
  171. X#define DA_CLEAN 2
  172. X#define DA_TOEND 3
  173. X
  174. Xvoid    art_init ANSI((void));
  175. Xint    do_article ANSI((void));
  176. Xint    page_switch ANSI((void));
  177. Xbool    innermore ANSI((void));
  178. END_OF_FILE
  179.   if test 481 -ne `wc -c <'art.h'`; then
  180.     echo shar: \"'art.h'\" unpacked with wrong size!
  181.   fi
  182.   # end of 'art.h'
  183. fi
  184. if test -f 'artsrch.h' -a "${1}" != "-c" ; then 
  185.   echo shar: Will not clobber existing file \"'artsrch.h'\"
  186. else
  187.   echo shar: Extracting \"'artsrch.h'\" \(1120 characters\)
  188.   sed "s/^X//" >'artsrch.h' <<'END_OF_FILE'
  189. X/* $Header: artsrch.h,v 4.3.3.1 91/01/16 02:21:37 davison Trn $
  190. X *
  191. X * $Log:    artsrch.h,v $
  192. X * Revision 4.3.3.1  91/01/16  02:21:37  davison
  193. X * Added optional prototyping.
  194. X * 
  195. X * Revision 4.3  85/05/01  11:35:55  lwall
  196. X * Baseline for release with 4.3bsd.
  197. X * 
  198. X */
  199. X
  200. X#ifndef NBRA
  201. X#include "search.h"
  202. X#endif
  203. X
  204. X#ifdef ARTSEARCH
  205. X
  206. X#define SRCH_ABORT 0
  207. X#define SRCH_INTR 1
  208. X#define SRCH_FOUND 2
  209. X#define SRCH_NOTFOUND 3
  210. X#define SRCH_DONE 4
  211. X#define SRCH_SUBJDONE 5
  212. X#define SRCH_ERROR 6
  213. X#endif
  214. X
  215. XEXT char *lastpat INIT(nullstr);    /* last search pattern */
  216. X#ifdef ARTSEARCH
  217. X    EXT COMPEX sub_compex;        /* last compiled subject search */
  218. X    EXT COMPEX art_compex;        /* last compiled normal search */
  219. X#   ifdef CONDSUB
  220. X    EXT COMPEX *bra_compex INIT(&art_compex);
  221. X                    /* current compex with brackets */
  222. X#   endif
  223. X    EXT char art_howmuch;        /* search just the subjects */
  224. X    EXT bool art_doread;        /* search read articles? */
  225. X#endif
  226. X
  227. Xvoid    artsrch_init ANSI((void));
  228. X#ifdef ARTSEARCH
  229. X    int        art_search ANSI((char *, int, int));
  230. X    bool    wanted ANSI((COMPEX *, ART_NUM, char));
  231. X            /* return TRUE if current article matches pattern */
  232. X#endif
  233. END_OF_FILE
  234.   if test 1120 -ne `wc -c <'artsrch.h'`; then
  235.     echo shar: \"'artsrch.h'\" unpacked with wrong size!
  236.   fi
  237.   # end of 'artsrch.h'
  238. fi
  239. if test -f 'artstate.h' -a "${1}" != "-c" ; then 
  240.   echo shar: Will not clobber existing file \"'artstate.h'\"
  241. else
  242.   echo shar: Extracting \"'artstate.h'\" \(1097 characters\)
  243.   sed "s/^X//" >'artstate.h' <<'END_OF_FILE'
  244. X/* $Header: artstate.h,v 4.3.1.2 85/05/13 09:30:30 lwall Exp $
  245. X *
  246. X * $Log:    artstate.h,v $
  247. X * Revision 4.3.1.2  85/05/13  09:30:30  lwall
  248. X * Added CUSTOMLINES option.
  249. X * 
  250. X * Revision 4.3.1.1  85/05/10  11:31:32  lwall
  251. X * Branch for patches.
  252. X * 
  253. X * Revision 4.3  85/05/01  11:35:59  lwall
  254. X * Baseline for release with 4.3bsd.
  255. X * 
  256. X */
  257. X
  258. XEXT bool reread INIT(FALSE);        /* consider current art temporarily */
  259. X                    /* unread? */
  260. XEXT bool do_fseek INIT(FALSE);    /* should we back up in article file? */
  261. X
  262. XEXT bool oldsubject INIT(FALSE);    /* not 1st art in subject thread */
  263. XEXT ART_LINE topline INIT(-1);        /* top line of current screen */
  264. XEXT bool do_hiding INIT(TRUE);        /* hide header lines with -h? */
  265. X#ifdef ROTATION
  266. XEXT bool rotate INIT(FALSE);        /* has rotation been requested? */
  267. X#endif
  268. XEXT char *prompt;            /* pointer to current prompt */
  269. X
  270. XEXT char *firstline INIT(Nullch);            /* special first line? */
  271. X#ifdef CUSTOMLINES
  272. XEXT char *hideline INIT(Nullch);        /* custom line hiding? */
  273. XEXT char *pagestop INIT(Nullch);        /* custom page terminator? */
  274. XEXT COMPEX hide_compex;
  275. XEXT COMPEX page_compex;
  276. X#endif
  277. END_OF_FILE
  278.   if test 1097 -ne `wc -c <'artstate.h'`; then
  279.     echo shar: \"'artstate.h'\" unpacked with wrong size!
  280.   fi
  281.   # end of 'artstate.h'
  282. fi
  283. if test -f 'backpage.h' -a "${1}" != "-c" ; then 
  284.   echo shar: Will not clobber existing file \"'backpage.h'\"
  285. else
  286.   echo shar: Extracting \"'backpage.h'\" \(651 characters\)
  287.   sed "s/^X//" >'backpage.h' <<'END_OF_FILE'
  288. X/* $Header: backpage.h,v 4.3.3.1 91/01/16 02:29:47 davison Trn $
  289. X *
  290. X * $Log:    backpage.h,v $
  291. X * Revision 4.3.3.1  91/01/16  02:29:47  davison
  292. X * Added optional prototyping.
  293. X * 
  294. X * Revision 4.3  85/05/01  11:36:11  lwall
  295. X * Baseline for release with 4.3bsd.
  296. X * 
  297. X */
  298. X
  299. X/* things for doing the 'back page' command */
  300. X
  301. XEXT int varyfd INIT(0);            /* virtual array file for storing  */
  302. X                    /* file offsets */
  303. XEXT ART_POS varybuf[VARYSIZE];        /* current window onto virtual array */
  304. X
  305. XEXT long oldoffset INIT(-1);        /* offset to block currently in window */
  306. X
  307. Xvoid    backpage_init ANSI((void));
  308. XART_POS    vrdary ANSI((ART_LINE));
  309. Xvoid    vwtary ANSI((ART_LINE,ART_POS));
  310. END_OF_FILE
  311.   if test 651 -ne `wc -c <'backpage.h'`; then
  312.     echo shar: \"'backpage.h'\" unpacked with wrong size!
  313.   fi
  314.   # end of 'backpage.h'
  315. fi
  316. if test -f 'cheat.h' -a "${1}" != "-c" ; then 
  317.   echo shar: Will not clobber existing file \"'cheat.h'\"
  318. else
  319.   echo shar: Extracting \"'cheat.h'\" \(572 characters\)
  320.   sed "s/^X//" >'cheat.h' <<'END_OF_FILE'
  321. X/* $Header: cheat.h,v 4.3.3.1 91/01/16 02:32:16 davison Trn $
  322. X *
  323. X * $Log:    cheat.h,v $
  324. X * Revision 4.3.3.1  91/01/16  02:32:16  davison
  325. X * Added optional prototyping.
  326. X * 
  327. X * Revision 4.3  85/05/01  11:36:58  lwall
  328. X * Baseline for release with 4.3bsd.
  329. X * 
  330. X */
  331. X
  332. X#ifdef ARTSEARCH
  333. XEXT ART_NUM srchahead INIT(0);     /* are we in subject scan mode? */
  334. X                /* (if so, contains art # found or -1) */
  335. X#endif
  336. X
  337. X#ifdef PENDING
  338. X#   ifdef CACHESUBJ
  339. X    EXT ART_NUM subj_to_get;
  340. X#   endif
  341. X#endif
  342. X
  343. Xvoid    cheat_init ANSI((void));
  344. Xvoid    look_ahead ANSI((void));
  345. Xvoid    collect_subjects ANSI((void));
  346. END_OF_FILE
  347.   if test 572 -ne `wc -c <'cheat.h'`; then
  348.     echo shar: \"'cheat.h'\" unpacked with wrong size!
  349.   fi
  350.   # end of 'cheat.h'
  351. fi
  352. if test -f 'final.h' -a "${1}" != "-c" ; then 
  353.   echo shar: Will not clobber existing file \"'final.h'\"
  354. else
  355.   echo shar: Extracting \"'final.h'\" \(1022 characters\)
  356.   sed "s/^X//" >'final.h' <<'END_OF_FILE'
  357. X/* $Header: final.h,v 4.3.3.2 91/01/16 02:38:16 davison Trn $
  358. X * 
  359. X * $Log:    final.h,v $
  360. X * Revision 4.3.3.2  91/01/16  02:38:16  davison
  361. X * Added optional prototyping.
  362. X * 
  363. X * Revision 4.3.3.1  90/06/20  22:37:04  davison
  364. X * Initial Trn Release
  365. X * 
  366. X * Revision 4.3  85/05/01  11:38:17  lwall
  367. X * Baseline for release with 4.3bsd.
  368. X * 
  369. X */
  370. X
  371. X/* cleanup status for fast exits */
  372. X
  373. XEXT bool panic INIT(FALSE);        /* we got hung up or something-- */
  374. X                    /*  so leave tty alone */
  375. XEXT bool rc_changed INIT(FALSE);    /* need we rewrite .newsrc? */
  376. XEXT bool doing_ng INIT(FALSE);        /* do we need to reconstitute */
  377. X                    /* current rc line? */
  378. X
  379. XEXT char int_count INIT(0);        /* how many interrupts we've had */
  380. X
  381. XEXT bool clear_on_stop INIT(FALSE);    /* set when handling the stop signal */
  382. X                    /* would leave the screen a mess */
  383. X
  384. X/* signal catching routines */
  385. X
  386. XSIGRET    int_catcher ANSI((void));
  387. XSIGRET    sig_catcher ANSI((int));
  388. X#ifdef SIGTSTP
  389. X SIGRET    stop_catcher ANSI((int));
  390. X#endif
  391. X
  392. Xvoid    final_init ANSI((void));
  393. Xvoid    finalize ANSI((int));
  394. END_OF_FILE
  395.   if test 1022 -ne `wc -c <'final.h'`; then
  396.     echo shar: \"'final.h'\" unpacked with wrong size!
  397.   fi
  398.   # end of 'final.h'
  399. fi
  400. if test -f 'help.h' -a "${1}" != "-c" ; then 
  401.   echo shar: Will not clobber existing file \"'help.h'\"
  402. else
  403.   echo shar: Extracting \"'help.h'\" \(556 characters\)
  404.   sed "s/^X//" >'help.h' <<'END_OF_FILE'
  405. X/* $Header: help.h,v 4.3.3.2 91/01/16 02:41:20 davison Trn $
  406. X *
  407. X * $Log:    help.h,v $
  408. X * Revision 4.3.3.2  91/01/16  02:41:20  davison
  409. X * Added optional prototyping.
  410. X * 
  411. X * Revision 4.3.3.1  90/06/20  22:37:34  davison
  412. X * Initial Trn Release
  413. X * 
  414. X * Revision 4.3  85/05/01  11:39:19  lwall
  415. X * Baseline for release with 4.3bsd.
  416. X * 
  417. X */
  418. X
  419. Xvoid    help_init ANSI((void));
  420. Xint    help_ng ANSI((void));
  421. Xint    help_art ANSI((void));
  422. Xint    help_page ANSI((void));
  423. X#ifdef ESCSUBS
  424. X    int    help_subs ANSI((void));
  425. X#endif
  426. X#ifdef USETHREADS
  427. X    int help_select ANSI((void));
  428. X#endif
  429. END_OF_FILE
  430.   if test 556 -ne `wc -c <'help.h'`; then
  431.     echo shar: \"'help.h'\" unpacked with wrong size!
  432.   fi
  433.   # end of 'help.h'
  434. fi
  435. if test -f 'init.h' -a "${1}" != "-c" ; then 
  436.   echo shar: Will not clobber existing file \"'init.h'\"
  437. else
  438.   echo shar: Extracting \"'init.h'\" \(393 characters\)
  439.   sed "s/^X//" >'init.h' <<'END_OF_FILE'
  440. X/* $Header: init.h,v 4.3.3.1 91/01/16 02:43:40 davison Trn $
  441. X *
  442. X * $Log:    init.h,v $
  443. X * Revision 4.3.3.1  91/01/16  02:43:40  davison
  444. X * Added optional prototyping.
  445. X * 
  446. X * Revision 4.3  85/05/01  11:40:46  lwall
  447. X * Baseline for release with 4.3bsd.
  448. X * 
  449. X */
  450. X
  451. XEXT char *lockname INIT(nullstr);
  452. X
  453. Xbool    initialize ANSI((int,char **));
  454. Xvoid    lock_check ANSI((void));
  455. Xvoid    newsnews_check ANSI((void));
  456. END_OF_FILE
  457.   if test 393 -ne `wc -c <'init.h'`; then
  458.     echo shar: \"'init.h'\" unpacked with wrong size!
  459.   fi
  460.   # end of 'init.h'
  461. fi
  462. if test -f 'intrp.h' -a "${1}" != "-c" ; then 
  463.   echo shar: Will not clobber existing file \"'intrp.h'\"
  464. else
  465.   echo shar: Extracting \"'intrp.h'\" \(1080 characters\)
  466.   sed "s/^X//" >'intrp.h' <<'END_OF_FILE'
  467. X/* $Header: intrp.h,v 4.3.3.2 91/01/16 02:43:45 davison Trn $
  468. X *
  469. X * $Log:    intrp.h,v $
  470. X * Revision 4.3.3.2  91/01/16  02:43:45  davison
  471. X * Added optional prototyping.
  472. X * 
  473. X * Revision 4.3.3.1  90/06/20  22:38:00  davison
  474. X * Initial Trn Release
  475. X * 
  476. X * Revision 4.3  85/05/01  11:41:48  lwall
  477. X * Baseline for release with 4.3bsd.
  478. X * 
  479. X */
  480. X
  481. XEXT char *lib INIT(Nullch);        /* news library */
  482. XEXT char *rnlib INIT(Nullch);        /* private news program library */
  483. XEXT char *origdir INIT(Nullch);        /* cwd when rn invoked */
  484. XEXT char *homedir INIT(Nullch);        /* login directory */
  485. XEXT char *dotdir INIT(Nullch);        /* where . files go */
  486. XEXT char *logname INIT(Nullch);        /* login id */
  487. XEXT char *sitename INIT(Nullch);    /* host name */
  488. XEXT int perform_cnt;
  489. X
  490. X#ifdef NEWSADMIN
  491. X    EXT char newsadmin[] INIT(NEWSADMIN);/* news administrator */
  492. X    EXT int newsuid INIT(0);
  493. X#endif
  494. X
  495. Xvoid    intrp_init ANSI((char *));
  496. Xchar    *filexp ANSI((char *));
  497. Xchar    *dointerp ANSI((char *,int,char *,char *));
  498. Xvoid    interp ANSI((char *,int,char *));
  499. Xvoid    refscpy ANSI((char *,int,char *));
  500. Xchar    *getrealname ANSI((int));
  501. END_OF_FILE
  502.   if test 1080 -ne `wc -c <'intrp.h'`; then
  503.     echo shar: \"'intrp.h'\" unpacked with wrong size!
  504.   fi
  505.   # end of 'intrp.h'
  506. fi
  507. if test -f 'kfile.h' -a "${1}" != "-c" ; then 
  508.   echo shar: Will not clobber existing file \"'kfile.h'\"
  509. else
  510.   echo shar: Extracting \"'kfile.h'\" \(720 characters\)
  511.   sed "s/^X//" >'kfile.h' <<'END_OF_FILE'
  512. X/* $Header: kfile.h,v 4.3.3.1 91/01/16 02:46:29 davison Trn $
  513. X *
  514. X * $Log:    kfile.h,v $
  515. X * Revision 4.3.3.1  91/01/16  02:46:29  davison
  516. X * Added optional prototyping.
  517. X * 
  518. X * Revision 4.3  85/05/01  11:42:00  lwall
  519. X * Baseline for release with 4.3bsd.
  520. X * 
  521. X */
  522. X
  523. X#define KF_GLOBAL 0
  524. X#define KF_LOCAL 1
  525. X
  526. X#ifdef KILLFILES
  527. XEXT FILE *globkfp INIT(Nullfp);        /* global article killer file */
  528. XEXT FILE *localkfp INIT(Nullfp);    /* local (for this newsgroup) */
  529. X                    /*  article killer file */
  530. X#endif
  531. X
  532. Xvoid    kfile_init ANSI((void));
  533. Xint    do_kfile ANSI((FILE *,int));
  534. Xvoid    kill_unwanted ANSI((ART_NUM,char *,int));
  535. Xint    edit_kfile ANSI((void));
  536. Xvoid    open_kfile ANSI((int));
  537. Xvoid    kf_append ANSI((char *));
  538. Xvoid    setthru ANSI((ART_NUM));
  539. END_OF_FILE
  540.   if test 720 -ne `wc -c <'kfile.h'`; then
  541.     echo shar: \"'kfile.h'\" unpacked with wrong size!
  542.   fi
  543.   # end of 'kfile.h'
  544. fi
  545. if test -f 'last.c' -a "${1}" != "-c" ; then 
  546.   echo shar: Will not clobber existing file \"'last.c'\"
  547. else
  548.   echo shar: Extracting \"'last.c'\" \(1405 characters\)
  549.   sed "s/^X//" >'last.c' <<'END_OF_FILE'
  550. X/* $Header: last.c,v 4.3.3.1 91/01/16 02:47:15 davison Trn $
  551. X *
  552. X * $Log:    last.c,v $
  553. X * Revision 4.3.3.1  91/01/16  02:47:15  davison
  554. X * Integrated rn patches 48-54.
  555. X * 
  556. X * Revision 4.3.2.1  89/12/20  23:23:07  sob
  557. X * .rnlast sometimes is a null file. This gives bogus information when
  558. X * restarting rn following an abnormal termination. This bug was reported
  559. X * by weening@gang-of-four.stanford.edu
  560. X * 
  561. X * Revision 4.3  85/05/01  11:42:16  lwall
  562. X * Baseline for release with 4.3bsd.
  563. X * 
  564. X */
  565. X
  566. X#include "EXTERN.h"
  567. X#include "common.h"
  568. X#include "rn.h"
  569. X#include "util.h"
  570. X#include "intrp.h"
  571. X#include "INTERN.h"
  572. X#include "last.h"
  573. X
  574. Xchar *lastname = Nullch;    /* path name of .rnlast file */
  575. X
  576. Xvoid
  577. Xlast_init(tcbuf)
  578. Xchar *tcbuf;
  579. X{
  580. X    lastname = savestr(filexp(LASTNAME));
  581. X    if ((tmpfp = fopen(lastname,"r")) != Nullfp &&
  582. X    fgets(tcbuf,1024,tmpfp) != Nullch) {
  583. X    tcbuf[strlen(tcbuf)-1] = '\0';
  584. X    lastngname = savestr(tcbuf);
  585. X    fgets(tcbuf,1024,tmpfp);
  586. X    lasttime = atol(tcbuf);
  587. X    fgets(tcbuf,1024,tmpfp);
  588. X    lastactsiz = atol(tcbuf);
  589. X    fclose(tmpfp);
  590. X    }
  591. X    else {
  592. X    lastngname = nullstr;
  593. X    lasttime = 0;
  594. X    lastactsiz = 0;
  595. X    }
  596. X}
  597. X
  598. X/* put out certain values for next run of rn */
  599. X
  600. Xvoid
  601. Xwritelast()
  602. X{
  603. X    if ((tmpfp = fopen(lastname,"w")) != Nullfp) {
  604. X    fprintf(tmpfp,"%s\n%ld\n%ld\n",
  605. X        (ngname==Nullch?nullstr:ngname),(long)lasttime,(long)lastactsiz);
  606. X    fclose(tmpfp);
  607. X    }
  608. X    else
  609. X    printf(cantcreate,lastname) FLUSH;
  610. X}
  611. END_OF_FILE
  612.   if test 1405 -ne `wc -c <'last.c'`; then
  613.     echo shar: \"'last.c'\" unpacked with wrong size!
  614.   fi
  615.   # end of 'last.c'
  616. fi
  617. if test -f 'last.h' -a "${1}" != "-c" ; then 
  618.   echo shar: Will not clobber existing file \"'last.h'\"
  619. else
  620.   echo shar: Extracting \"'last.h'\" \(541 characters\)
  621.   sed "s/^X//" >'last.h' <<'END_OF_FILE'
  622. X/* $Header: last.h,v 4.3.3.1 91/01/16 02:47:16 davison Trn $
  623. X *
  624. X * $Log:    last.h,v $
  625. X * Revision 4.3.3.1  91/01/16  02:47:16  davison
  626. X * Added optional prototyping.
  627. X * 
  628. X * Revision 4.3  85/05/01  11:42:22  lwall
  629. X * Baseline for release with 4.3bsd.
  630. X * 
  631. X */
  632. X
  633. XEXT char *lastngname INIT(Nullch);    /* last newsgroup read, from .rnlast file */
  634. XEXT long lasttime INIT(0);    /* time last rn was started up */
  635. XEXT long lastactsiz INIT(0);    /* size of active file when rn last started up */
  636. X
  637. Xvoid    last_init ANSI((char *));
  638. Xvoid    writelast ANSI((void));
  639. END_OF_FILE
  640.   if test 541 -ne `wc -c <'last.h'`; then
  641.     echo shar: \"'last.h'\" unpacked with wrong size!
  642.   fi
  643.   # end of 'last.h'
  644. fi
  645. if test -f 'makedir.SH' -a "${1}" != "-c" ; then 
  646.   echo shar: Will not clobber existing file \"'makedir.SH'\"
  647. else
  648.   echo shar: Extracting \"'makedir.SH'\" \(1263 characters\)
  649.   sed "s/^X//" >'makedir.SH' <<'END_OF_FILE'
  650. Xcase $CONFIG in
  651. X    '') . ./config.sh ;;
  652. Xesac
  653. Xecho "Extracting makedir (with variable substitutions)"
  654. X$spitshell >makedir <<!GROK!THIS!
  655. X$startsh
  656. X# $Header: makedir.SH,v 4.3.3.1 91/01/16 02:48:09 davison Trn $
  657. X# 
  658. X# $Log:    makedir.SH,v $
  659. X# Revision 4.3.3.1  91/01/16  02:48:09  davison
  660. X# Integrated rn patches 48-54.
  661. X# 
  662. X# Revision 4.3.2.1  90/11/22  14:02:49  sob
  663. X# changes . config.sh to . ./config.sh
  664. X# 
  665. X# Revision 4.3  85/05/01  11:42:31  lwall
  666. X# Baseline for release with 4.3bsd.
  667. X# 
  668. X
  669. Xexport PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
  670. X
  671. Xcase \$# in
  672. X  0)
  673. X    $echo "makedir pathname filenameflag"
  674. X    exit 1
  675. X    ;;
  676. Xesac
  677. X
  678. X: guarantee one slash before 1st component
  679. Xcase \$1 in
  680. X  /*) ;;
  681. X  *)  set ./\$1 \$2 ;;
  682. Xesac
  683. X
  684. X: strip last component if it is to be a filename
  685. Xcase X\$2 in
  686. X  X1) set \`$echo \$1 | $sed 's:\(.*\)/[^/]*\$:\1:'\` ;;
  687. X  *)  set \$1 ;;
  688. Xesac
  689. X
  690. X: return reasonable status if nothing to be created
  691. Xif $test -d "\$1" ; then
  692. X    exit 0
  693. Xfi
  694. X
  695. Xlist=''
  696. Xwhile true ; do
  697. X    case \$1 in
  698. X    */*)
  699. X    list="\$1 \$list"
  700. X    set \`echo \$1 | $sed 's:\(.*\)/:\1 :'\`
  701. X    ;;
  702. X    *)
  703. X    break
  704. X    ;;
  705. X    esac
  706. Xdone
  707. X
  708. Xset \$list
  709. X
  710. Xfor dir do
  711. X    $mkdir \$dir >/dev/null 2>&1
  712. Xdone
  713. X!GROK!THIS!
  714. X$eunicefix makedir
  715. Xchmod 755 makedir
  716. END_OF_FILE
  717.   if test 1263 -ne `wc -c <'makedir.SH'`; then
  718.     echo shar: \"'makedir.SH'\" unpacked with wrong size!
  719.   fi
  720.   chmod +x 'makedir.SH'
  721.   # end of 'makedir.SH'
  722. fi
  723. if test -f 'makekit' -a "${1}" != "-c" ; then 
  724.   echo shar: Will not clobber existing file \"'makekit'\"
  725. else
  726.   echo shar: Extracting \"'makekit'\" \(745 characters\)
  727.   sed "s/^X//" >'makekit' <<'END_OF_FILE'
  728. X#!/bin/sh
  729. X# $Header: makekit,v 4.3 85/05/01 11:42:38 lwall Exp $
  730. X#
  731. X# $Log:    makekit,v $
  732. X# Revision 4.3  85/05/01  11:42:38  lwall
  733. X# Baseline for release with 4.3bsd.
  734. X# 
  735. X
  736. Xnumkits=$#
  737. Xfor kitlist in $*; do
  738. X    kit=`basename $kitlist .list`
  739. X    kitnum=`expr "$kit" : 'kit\([0-9][0-9]*\)'`
  740. X    echo "*** Making $kit ***"
  741. X    kitleader "$kit" "$kitnum" "$numkits"
  742. X    for file in `/bin/cat $kitlist`; do
  743. X    echo $file
  744. X    echo "echo Extracting $file" >> $kit
  745. X    if egrep '^\.$' $file; then
  746. X        echo "sed >$file <<'!STUFFY!FUNK!' -e 's/X//'" >> $kit
  747. X        sed <$file >>$kit -e 's/^/X/'
  748. X    else
  749. X        echo "cat >$file <<'!STUFFY!FUNK!'" >> $kit
  750. X        /bin/cat $file >> $kit
  751. X    fi
  752. X    echo "!STUFFY!FUNK!" >> $kit
  753. X    done
  754. X    kittrailer "$kit" "$kitnum" "$numkits"
  755. Xdone
  756. END_OF_FILE
  757.   if test 745 -ne `wc -c <'makekit'`; then
  758.     echo shar: \"'makekit'\" unpacked with wrong size!
  759.   fi
  760.   chmod +x 'makekit'
  761.   # end of 'makekit'
  762. fi
  763. if test -f 'mt-lint.h' -a "${1}" != "-c" ; then 
  764.   echo shar: Will not clobber existing file \"'mt-lint.h'\"
  765. else
  766.   echo shar: Extracting \"'mt-lint.h'\" \(1542 characters\)
  767.   sed "s/^X//" >'mt-lint.h' <<'END_OF_FILE'
  768. X/* $Header: mt-lint.h,v 4.3.3.2 91/01/16 02:49:11 davison Trn $
  769. X**
  770. X** $Log:    mt-lint.h,v $
  771. X** Revision 4.3.3.2  91/01/16  02:49:11  davison
  772. X** Changed Free() to safefree().
  773. X** 
  774. X** Revision 4.3.3.1  90/06/20  22:55:11  davison
  775. X** Initial Trn Release
  776. X** 
  777. X** Handle brain-dead lints that only have 6 significant-character names.
  778. X*/
  779. X
  780. X#define subject_cnts        sucnts
  781. X#define subject_array        suarra
  782. X#define subject_strings        sustri
  783. X#define subject_str        sustr
  784. X#define author_cnts        aucnts
  785. X#define author_array        auarra
  786. X#define author_root        auroot
  787. X#define author_str        austr
  788. X#define valid_subject        vsubje
  789. X#define valid_author        vautho
  790. X#define valid_message_id    vmsgid
  791. X#define read_authors        rautho
  792. X#define read_articles        rartic
  793. X#define read_ids        rids
  794. X#define read_item        ritem
  795. X#define processed_groups    pgroup
  796. X#define process_articles    partic
  797. X#define expired_articles    eartic
  798. X#define unlink_child        uchild
  799. X#define unlink_root        uroot
  800. X#define free_article        fartic
  801. X#define free_author        fautho
  802. X#define enumerate_articles    enarti
  803. X#define enumerate_thread    enthrd
  804. X#define string_offset        soffst
  805. X#define write_authors        wautho
  806. X#define write_subjects        wsubje
  807. X#define write_roots        wroots
  808. X#define write_articles        wartic
  809. X#define write_thread        wthred
  810. X#define write_ids        wids
  811. X#define write_item        witem
  812. X#define processed_groups    pgroup
  813. X#define timer_off        timoff
  814. X#define timer_first        tim1st
  815. X#define timer_next        timnxt
  816. X#define truncate_len        trulen
  817. X#define article_array        artarr
  818. X
  819. X#define safemalloc(x)    (NULL)
  820. X#define free(x)        (x = NULL)
  821. X#define safefree(x)    (*x = NULL)
  822. X#define signal(x,y)
  823. END_OF_FILE
  824.   if test 1542 -ne `wc -c <'mt-lint.h'`; then
  825.     echo shar: \"'mt-lint.h'\" unpacked with wrong size!
  826.   fi
  827.   # end of 'mt-lint.h'
  828. fi
  829. if test -f 'newsnews.SH' -a "${1}" != "-c" ; then 
  830.   echo shar: Will not clobber existing file \"'newsnews.SH'\"
  831. else
  832.   echo shar: Extracting \"'newsnews.SH'\" \(1299 characters\)
  833.   sed "s/^X//" >'newsnews.SH' <<'END_OF_FILE'
  834. Xcase $CONFIG in
  835. X    '') . ./config.sh ;;
  836. Xesac
  837. Xecho "Extracting newsnews (with variable substitutions)"
  838. Xcat >newsnews <<!GROK!THIS!
  839. X            *** NEWS NEWS ***
  840. X
  841. XWelcome to trn.  There are more options to trn than you want to think about,
  842. Xso we won't list them here.  If you want to find out about them, read the
  843. Xtrn manual page.  There are some important things to remember, though:
  844. X
  845. X  * Trn is an extention to rn.  Where possible, the command syntax is the same.
  846. X  * To access all the new features, specify the options -x and -X.  These
  847. X    options MAY be on by default, but it won't hurt to be redundant.
  848. X  * At ANY prompt in trn, you may type 'h' for help.  There are many different
  849. X    help menus, depending on where you are.  Typing <esc>h in the
  850. X    middle of a multi-character command will list escape substitutions.
  851. X  * Typing a space to any prompt means to do the normal thing.  You could
  852. X    spend all day reading news and never hit anything but the space bar.
  853. X
  854. XThis particular message comes from $rnlib/newsnews.  You will only
  855. Xsee it once.  Your news administrator should feel free to substitute his or
  856. Xher own message whenever something new happens to trn, and then the file
  857. Xwill again be displayed, just once for each person.
  858. X
  859. XWayne Davison    davison@borland.com
  860. X!GROK!THIS!
  861. X$eunicefix newsnews
  862. END_OF_FILE
  863.   if test 1299 -ne `wc -c <'newsnews.SH'`; then
  864.     echo shar: \"'newsnews.SH'\" unpacked with wrong size!
  865.   fi
  866.   chmod +x 'newsnews.SH'
  867.   # end of 'newsnews.SH'
  868. fi
  869. if test -f 'ng.h' -a "${1}" != "-c" ; then 
  870.   echo shar: Will not clobber existing file \"'ng.h'\"
  871. else
  872.   echo shar: Extracting \"'ng.h'\" \(1087 characters\)
  873.   sed "s/^X//" >'ng.h' <<'END_OF_FILE'
  874. X/* $Header: ng.h,v 4.3.3.1 91/01/16 03:18:20 davison Trn $
  875. X *
  876. X * $Log:    ng.h,v $
  877. X * Revision 4.3.3.1  91/01/16  03:18:20  davison
  878. X * Added optional prototyping.
  879. X * 
  880. X * Revision 4.3  85/05/01  11:44:29  lwall
  881. X * Baseline for release with 4.3bsd.
  882. X * 
  883. X */
  884. X
  885. XEXT ART_NUM art INIT(0);    /* current or prospective article # */
  886. X
  887. XEXT int checkcount INIT(0);    /* how many articles have we read */
  888. X            /*   in the current newsgroup since */
  889. X            /*   the last checkpoint? */
  890. XEXT int docheckwhen INIT(20);    /* how often to do checkpoint */
  891. X
  892. X#ifdef MAILCALL
  893. XEXT int mailcount INIT(0);            /* check for mail when 0 mod 10 */
  894. X#endif
  895. XEXT char *mailcall INIT(nullstr);
  896. X
  897. XEXT bool forcelast INIT(FALSE);            /* ought we show "End of newsgroup"? */
  898. XEXT bool forcegrow INIT(FALSE);        /* do we want to recalculate size */
  899. X                    /* of newsgroup, e.g. after posting? */
  900. X
  901. X#define NG_ERROR -1
  902. X#define NG_NORM 0
  903. X#define NG_ASK 1
  904. X#define NG_MINUS 2
  905. X
  906. Xvoid    ng_init ANSI((void));
  907. Xint    do_newsgroup ANSI((char *));
  908. Xint    art_switch ANSI((void));
  909. X#ifdef MAILCALL
  910. X    void    setmail ANSI((void));
  911. X#endif
  912. Xvoid    setdfltcmd ANSI((void));
  913. END_OF_FILE
  914.   if test 1087 -ne `wc -c <'ng.h'`; then
  915.     echo shar: \"'ng.h'\" unpacked with wrong size!
  916.   fi
  917.   # end of 'ng.h'
  918. fi
  919. if test -f 'ngdata.h' -a "${1}" != "-c" ; then 
  920.   echo shar: Will not clobber existing file \"'ngdata.h'\"
  921. else
  922.   echo shar: Extracting \"'ngdata.h'\" \(1141 characters\)
  923.   sed "s/^X//" >'ngdata.h' <<'END_OF_FILE'
  924. X/* $Header: ngdata.h,v 4.3.3.2 91/01/16 03:18:22 davison Trn $
  925. X *
  926. X * $Log:    ngdata.h,v $
  927. X * Revision 4.3.3.2  91/01/16  03:18:22  davison
  928. X * Added optional prototyping.
  929. X * 
  930. X * Revision 4.3.3.1  90/06/20  22:38:50  davison
  931. X * Initial Trn Release
  932. X * 
  933. X * Revision 4.3.2.1  89/11/06  00:41:21  sob
  934. X * Added RRN support from NNTP 1.5
  935. X * 
  936. X * Revision 4.3  85/05/01  11:44:48  lwall
  937. X * added to local RCS
  938. X * 
  939. X * Revision 4.3  85/05/01  11:44:48  lwall
  940. X * Baseline for release with 4.3bsd.
  941. X * 
  942. X */
  943. X
  944. XEXT FILE *actfp INIT(Nullfp);    /* the active file */
  945. XEXT bool writesoft INIT(FALSE);    /* rewrite the soft pointer file? */
  946. XEXT int softtries INIT(0), softmisses INIT(0);
  947. X
  948. X#ifdef SERVER
  949. X    EXT char active_name[256];
  950. X#endif
  951. X
  952. X#ifdef CACHEFIRST
  953. X    EXT ART_NUM abs1st[MAXRCLINE];    /* 1st real article in newsgroup */
  954. X#else
  955. X# ifdef MININACT
  956. X    EXT ART_NUM abs1st INIT(0);
  957. X# endif
  958. X#endif
  959. X
  960. XEXT char *moderated;
  961. X#ifdef USETHREADS
  962. XEXT bool ThreadedGroup;
  963. X#endif
  964. X
  965. Xvoid    ngdata_init ANSI((void));
  966. XART_NUM    getngsize ANSI((NG_NUM));
  967. XACT_POS findact ANSI((char *,char *,int,long));
  968. XART_NUM    getabsfirst ANSI((NG_NUM,ART_NUM));
  969. XART_NUM    getngmin ANSI((char *,ART_NUM));
  970. END_OF_FILE
  971.   if test 1141 -ne `wc -c <'ngdata.h'`; then
  972.     echo shar: \"'ngdata.h'\" unpacked with wrong size!
  973.   fi
  974.   # end of 'ngdata.h'
  975. fi
  976. if test -f 'ngsrch.h' -a "${1}" != "-c" ; then 
  977.   echo shar: Will not clobber existing file \"'ngsrch.h'\"
  978. else
  979.   echo shar: Extracting \"'ngsrch.h'\" \(635 characters\)
  980.   sed "s/^X//" >'ngsrch.h' <<'END_OF_FILE'
  981. X/* $Header: ngsrch.h,v 4.3.3.1 91/01/16 03:18:24 davison Trn $
  982. X *
  983. X * $Log:    ngsrch.h,v $
  984. X * Revision 4.3.3.1  91/01/16  03:18:24  davison
  985. X * Added optional prototyping.
  986. X * 
  987. X * Revision 4.3  85/05/01  11:44:56  lwall
  988. X * Baseline for release with 4.3bsd.
  989. X * 
  990. X */
  991. X
  992. X#ifdef NGSEARCH
  993. X#define NGS_ABORT 0
  994. X#define NGS_FOUND 1
  995. X#define NGS_INTR 2
  996. X#define NGS_NOTFOUND 3
  997. X
  998. XEXT bool ng_doread INIT(FALSE);        /* search read newsgroups? */
  999. X#endif
  1000. X
  1001. Xvoid    ngsrch_init ANSI((void));
  1002. X#ifdef NGSEARCH 
  1003. X    int        ng_search ANSI((char *,int));
  1004. X    bool    ng_wanted ANSI((void));
  1005. X#endif
  1006. X#ifdef NGSORONLY
  1007. X    char    *ng_comp ANSI((COMPEX *,char *,bool,bool));
  1008. X#endif
  1009. END_OF_FILE
  1010.   if test 635 -ne `wc -c <'ngsrch.h'`; then
  1011.     echo shar: \"'ngsrch.h'\" unpacked with wrong size!
  1012.   fi
  1013.   # end of 'ngsrch.h'
  1014. fi
  1015. if test -f 'ngstuff.h' -a "${1}" != "-c" ; then 
  1016.   echo shar: Will not clobber existing file \"'ngstuff.h'\"
  1017. else
  1018.   echo shar: Extracting \"'ngstuff.h'\" \(685 characters\)
  1019.   sed "s/^X//" >'ngstuff.h' <<'END_OF_FILE'
  1020. X/* $Header: ngstuff.h,v 4.3.3.2 91/01/16 03:18:27 davison Trn $
  1021. X *
  1022. X * $Log:    ngstuff.h,v $
  1023. X * Revision 4.3.3.2  91/01/16  03:18:27  davison
  1024. X * Added optional prototyping.
  1025. X * 
  1026. X * Revision 4.3.3.1  90/06/20  22:39:07  davison
  1027. X * Initial Trn Release
  1028. X * 
  1029. X * Revision 4.3  85/05/01  11:45:12  lwall
  1030. X * Baseline for release with 4.3bsd.
  1031. X * 
  1032. X */
  1033. X
  1034. X#define NN_NORM 0
  1035. X#define NN_INP 1
  1036. X#define NN_REREAD 2
  1037. X#define NN_ASK 3
  1038. X
  1039. XEXT bool one_command INIT(FALSE);    /* no ':' processing in perform() */
  1040. X
  1041. Xvoid    ngstuff_init ANSI((void));
  1042. Xint    escapade ANSI((void));
  1043. Xint    switcheroo ANSI((void));
  1044. Xint    numnum ANSI((void));
  1045. Xint    perform ANSI((char *,int));
  1046. X#ifdef USETHREADS
  1047. Xint    use_selected ANSI((void));
  1048. X#endif
  1049. END_OF_FILE
  1050.   if test 685 -ne `wc -c <'ngstuff.h'`; then
  1051.     echo shar: \"'ngstuff.h'\" unpacked with wrong size!
  1052.   fi
  1053.   # end of 'ngstuff.h'
  1054. fi
  1055. if test -f 'norm.saver.SH' -a "${1}" != "-c" ; then 
  1056.   echo shar: Will not clobber existing file \"'norm.saver.SH'\"
  1057. else
  1058.   echo shar: Extracting \"'norm.saver.SH'\" \(1134 characters\)
  1059.   sed "s/^X//" >'norm.saver.SH' <<'END_OF_FILE'
  1060. Xcase $CONFIG in
  1061. X    '') . ./config.sh ;;
  1062. Xesac
  1063. Xecho "Extracting norm.saver (with variable substitutions)"
  1064. X$spitshell >norm.saver <<!GROK!THIS!
  1065. X$startsh
  1066. X# $Header: norm.saver.SH,v 4.3.2.2 90/11/22 15:44:06 sob Exp $
  1067. X# 
  1068. X# $Log:    norm.saver.SH,v $
  1069. X# Revision 4.3.2.2  90/11/22  15:44:06  sob
  1070. X# Changed . config.sh to . ./config.sh
  1071. X# 
  1072. X# Revision 4.3.2.1  89/11/28  00:08:01  sob
  1073. X# Branch for RN/RRN combo.
  1074. X# 
  1075. X# Revision 4.3.1.2  85/05/20  15:56:24  lwall
  1076. X# Turned $5 into \$5.
  1077. X# 
  1078. X# Revision 4.3.1.1  85/05/10  11:36:52  lwall
  1079. X# Branch for patches.
  1080. X# 
  1081. X# Revision 4.3  85/05/01  11:45:16  lwall
  1082. X# Baseline for release with 4.3bsd.
  1083. X# 
  1084. X# 
  1085. X#    Arguments:
  1086. X#    1 Full name of article (%A)
  1087. X#    2 Public news spool directory (%P)
  1088. X#    3 Directory of current newsgroup (%c)
  1089. X#    4 Article number (%a)
  1090. X#    5 Where in article to start (%B)
  1091. X#    6 Newsgroup name (%C)
  1092. X#    7 Save destination (%b)
  1093. X#
  1094. Xexport PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
  1095. X
  1096. X( case "\$5" in
  1097. X  0) $echo "Article \$4 of \$6:" ;;
  1098. X  esac
  1099. X  $tail +\$5c \$1
  1100. X  $echo ""
  1101. X  $echo "" ) >> \$7
  1102. X!GROK!THIS!
  1103. X$eunicefix norm.saver
  1104. Xchmod 755 norm.saver
  1105. END_OF_FILE
  1106.   if test 1134 -ne `wc -c <'norm.saver.SH'`; then
  1107.     echo shar: \"'norm.saver.SH'\" unpacked with wrong size!
  1108.   fi
  1109.   chmod +x 'norm.saver.SH'
  1110.   # end of 'norm.saver.SH'
  1111. fi
  1112. if test -f 'only.h' -a "${1}" != "-c" ; then 
  1113.   echo shar: Will not clobber existing file \"'only.h'\"
  1114. else
  1115.   echo shar: Extracting \"'only.h'\" \(800 characters\)
  1116.   sed "s/^X//" >'only.h' <<'END_OF_FILE'
  1117. X/* $Header: only.h,v 4.3.3.1 91/01/16 03:26:16 davison Trn $
  1118. X *
  1119. X * $Log:    only.h,v $
  1120. X * Revision 4.3.3.1  91/01/16  03:26:16  davison
  1121. X * Added optional prototyping.
  1122. X * 
  1123. X * Revision 4.3  85/05/01  11:45:27  lwall
  1124. X * Baseline for release with 4.3bsd.
  1125. X * 
  1126. X */
  1127. X
  1128. X#ifndef NBRA
  1129. X#include "search.h"
  1130. X#endif
  1131. X
  1132. X#ifdef ONLY
  1133. X    EXT char *ngtodo[NGMAX];        /* restrictions in effect */
  1134. X#   ifdef SPEEDOVERMEM
  1135. X    EXT COMPEX *compextodo[NGMAX];    /* restrictions in compiled form */
  1136. X#   endif
  1137. X#endif
  1138. X
  1139. XEXT int maxngtodo INIT(0);            /*  0 => no restrictions */
  1140. X                    /* >0 => # of entries in ngtodo */
  1141. X
  1142. Xvoid    only_init ANSI((void));
  1143. Xbool    inlist ANSI((char *));    /* return TRUE if ngname is in command line list */
  1144. X            /* or if there was no list */
  1145. Xvoid    setngtodo ANSI((char *));
  1146. X#ifdef ONLY
  1147. X    void    end_only ANSI((void));
  1148. X#endif
  1149. END_OF_FILE
  1150.   if test 800 -ne `wc -c <'only.h'`; then
  1151.     echo shar: \"'only.h'\" unpacked with wrong size!
  1152.   fi
  1153.   # end of 'only.h'
  1154. fi
  1155. if test -f 'rcln.h' -a "${1}" != "-c" ; then 
  1156.   echo shar: Will not clobber existing file \"'rcln.h'\"
  1157. else
  1158.   echo shar: Extracting \"'rcln.h'\" \(727 characters\)
  1159.   sed "s/^X//" >'rcln.h' <<'END_OF_FILE'
  1160. X/* $Header: rcln.h,v 4.3.3.2 91/01/16 03:28:33 davison Trn $
  1161. X *
  1162. X * $Log:    rcln.h,v $
  1163. X * Revision 4.3.3.2  91/01/16  03:28:33  davison
  1164. X * Added optional prototyping.
  1165. X * 
  1166. X * Revision 4.3.3.1  90/08/20  16:47:22  davison
  1167. X * Removed ngmax array.
  1168. X * 
  1169. X * Revision 4.3  85/05/01  11:45:52  lwall
  1170. X * Baseline for release with 4.3bsd.
  1171. X * 
  1172. X */
  1173. X
  1174. X#if defined(DEBUGGING) && !defined(USETHREADS)
  1175. XEXT ART_NUM ngmax[MAXRCLINE];
  1176. X#endif
  1177. X
  1178. Xvoid    rcln_init ANSI((void));
  1179. X#ifdef CATCHUP
  1180. X    void    catch_up ANSI((NG_NUM));
  1181. X#endif
  1182. Xint    addartnum ANSI((ART_NUM,char *));
  1183. X#ifdef MCHASE
  1184. X    void    subartnum ANSI((ART_NUM,char *));
  1185. X#endif
  1186. Xvoid    prange ANSI((char *,ART_NUM,ART_NUM));
  1187. Xvoid    set_toread ANSI((NG_NUM));
  1188. Xvoid    checkexpired ANSI((NG_NUM,ART_NUM));
  1189. END_OF_FILE
  1190.   if test 727 -ne `wc -c <'rcln.h'`; then
  1191.     echo shar: \"'rcln.h'\" unpacked with wrong size!
  1192.   fi
  1193.   # end of 'rcln.h'
  1194. fi
  1195. if test -f 'rcstuff.h' -a "${1}" != "-c" ; then 
  1196.   echo shar: Will not clobber existing file \"'rcstuff.h'\"
  1197. else
  1198.   echo shar: Extracting \"'rcstuff.h'\" \(1543 characters\)
  1199.   sed "s/^X//" >'rcstuff.h' <<'END_OF_FILE'
  1200. X/* $Header: rcstuff.h,v 4.3.3.1 91/01/16 03:28:37 davison Trn $
  1201. X *
  1202. X * $Log:    rcstuff.h,v $
  1203. X * Revision 4.3.3.1  91/01/16  03:28:37  davison
  1204. X * Added optional prototyping.
  1205. X * 
  1206. X * Revision 4.3  85/05/01  11:46:49  lwall
  1207. X * Baseline for release with 4.3bsd.
  1208. X * 
  1209. X */
  1210. X
  1211. XEXT char *rcline[MAXRCLINE];/* pointers to lines of .newsrc */
  1212. XEXT ART_UNREAD toread[MAXRCLINE];
  1213. X            /* number of articles to be read in newsgroup */
  1214. X            /* <0 => invalid or unsubscribed newsgroup */
  1215. X#define TR_ONE ((ART_UNREAD) 1)
  1216. X#define TR_NONE ((ART_UNREAD) 0)
  1217. X#define TR_UNSUB ((ART_UNREAD) -1)
  1218. X            /* keep this one as -1, some tests use >= TR_UNSUB */
  1219. X#define TR_BOGUS ((ART_UNREAD) -2)
  1220. X#define TR_JUNK ((ART_UNREAD) -3)
  1221. X
  1222. XEXT char rcchar[MAXRCLINE]; /* holds the character : or ! while spot is \0 */
  1223. XEXT char rcnums[MAXRCLINE]; /* offset from rcline to numbers on line */
  1224. XEXT ACT_POS softptr[MAXRCLINE];
  1225. X            /* likely ptr to active file entry for newsgroup */
  1226. XEXT bool paranoid INIT(FALSE);    /* did we detect some inconsistency in .newsrc? */
  1227. X
  1228. Xbool    rcstuff_init ANSI((void));
  1229. Xbool    get_ng ANSI((char *,bool));    /* return TRUE if newsgroup can be found or added */
  1230. XNG_NUM    add_newsgroup ANSI((char *,char));
  1231. X#ifdef RELOCATE
  1232. X    NG_NUM    relocate_newsgroup ANSI((NG_NUM,NG_NUM));/* move newsgroup around */
  1233. X#endif
  1234. Xvoid    list_newsgroups ANSI((void));
  1235. XNG_NUM    find_ng ANSI((char *));    /* return index of newsgroup */
  1236. Xvoid    cleanup_rc ANSI((void));
  1237. Xvoid    sethash ANSI((NG_NUM));
  1238. Xint    hash ANSI((char *));
  1239. Xvoid    newsrc_check ANSI((void));
  1240. Xvoid    write_rc ANSI((void));
  1241. Xvoid    get_old_rc ANSI((void));
  1242. END_OF_FILE
  1243.   if test 1543 -ne `wc -c <'rcstuff.h'`; then
  1244.     echo shar: \"'rcstuff.h'\" unpacked with wrong size!
  1245.   fi
  1246.   # end of 'rcstuff.h'
  1247. fi
  1248. if test -f 'respond.h' -a "${1}" != "-c" ; then 
  1249.   echo shar: Will not clobber existing file \"'respond.h'\"
  1250. else
  1251.   echo shar: Extracting \"'respond.h'\" \(753 characters\)
  1252.   sed "s/^X//" >'respond.h' <<'END_OF_FILE'
  1253. X/* $Header: respond.h,v 4.3.3.2 91/01/16 03:28:41 davison Trn $
  1254. X *
  1255. X * $Log:    respond.h,v $
  1256. X * Revision 4.3.3.2  91/01/16  03:28:41  davison
  1257. X * Added optional prototyping.
  1258. X * 
  1259. X * Revision 4.3.3.1  90/06/20  22:39:54  davison
  1260. X * Initial Trn Release
  1261. X * 
  1262. X * Revision 4.3  85/05/01  11:47:50  lwall
  1263. X * Baseline for release with 4.3bsd.
  1264. X * 
  1265. X */
  1266. X
  1267. XEXT char *savedest INIT(Nullch);    /* value of %b */
  1268. XEXT char *extractprog INIT(Nullch);    /* value of %e */
  1269. XEXT ART_POS savefrom INIT(0);        /* value of %B */
  1270. XEXT char *headname INIT(Nullch);
  1271. X
  1272. X#define SAVE_ABORT 0
  1273. X#define SAVE_DONE 1
  1274. X
  1275. Xvoid    respond_init ANSI((void));
  1276. Xint    save_article ANSI((void));
  1277. Xint    cancel_article ANSI((void));
  1278. Xvoid    reply ANSI((void));
  1279. Xvoid    followup ANSI((void));
  1280. Xvoid    invoke ANSI((char *,char *));
  1281. END_OF_FILE
  1282.   if test 753 -ne `wc -c <'respond.h'`; then
  1283.     echo shar: \"'respond.h'\" unpacked with wrong size!
  1284.   fi
  1285.   # end of 'respond.h'
  1286. fi
  1287. if test -f 'rn.h' -a "${1}" != "-c" ; then 
  1288.   echo shar: Will not clobber existing file \"'rn.h'\"
  1289. else
  1290.   echo shar: Extracting \"'rn.h'\" \(958 characters\)
  1291.   sed "s/^X//" >'rn.h' <<'END_OF_FILE'
  1292. X/* $Header: rn.h,v 4.3.3.1 91/01/16 03:28:44 davison Trn $
  1293. X *
  1294. X * $Log:    rn.h,v $
  1295. X * Revision 4.3.3.1  91/01/16  03:28:44  davison
  1296. X * Added optional prototyping.
  1297. X * 
  1298. X * Revision 4.3  85/05/01  11:48:19  lwall
  1299. X * Baseline for release with 4.3bsd.
  1300. X * 
  1301. X */
  1302. X
  1303. XEXT char *ngname INIT(Nullch);        /* name of current newsgroup */
  1304. XEXT int ngnlen INIT(0);            /* current malloced size of ngname */
  1305. XEXT char *ngdir INIT(Nullch);        /* same thing in directory name form */
  1306. XEXT int ngdlen INIT(0);            /* current malloced size of ngdir */
  1307. X
  1308. XEXT NG_NUM ng INIT(0);        /* current newsgroup index into rcline and toread */
  1309. XEXT NG_NUM current_ng INIT(0);    /* stable current newsgroup so we can ditz with ng */
  1310. XEXT NG_NUM starthere INIT(0);   /* set to the first newsgroup with unread news on startup */
  1311. XEXT char *spool INIT(Nullch);        /* public news spool directory */
  1312. X
  1313. Xvoid    rn_init ANSI((void));
  1314. Xvoid    main ANSI((int,char **));
  1315. Xvoid    set_ngname ANSI((char *));
  1316. Xchar    *getngdir ANSI((char *));
  1317. END_OF_FILE
  1318.   if test 958 -ne `wc -c <'rn.h'`; then
  1319.     echo shar: \"'rn.h'\" unpacked with wrong size!
  1320.   fi
  1321.   # end of 'rn.h'
  1322. fi
  1323. if test -f 'search.h' -a "${1}" != "-c" ; then 
  1324.   echo shar: Will not clobber existing file \"'search.h'\"
  1325. else
  1326.   echo shar: Extracting \"'search.h'\" \(1354 characters\)
  1327.   sed "s/^X//" >'search.h' <<'END_OF_FILE'
  1328. X/* $Header: search.h,v 4.3.3.1 91/01/16 03:37:37 davison Trn $
  1329. X *
  1330. X * $Log:    search.h,v $
  1331. X * Revision 4.3.3.1  91/01/16  03:37:37  davison
  1332. X * Added optional prototyping.
  1333. X * 
  1334. X * Revision 4.3  85/05/01  11:50:46  lwall
  1335. X * Baseline for release with 4.3bsd.
  1336. X * 
  1337. X */
  1338. X
  1339. X#ifndef NBRA
  1340. X#define    NBRA    10        /* the maximum number of meta-brackets in an
  1341. X                   RE -- \( \) */
  1342. X#define NALTS    10        /* the maximum number of \|'s */
  1343. Xtypedef struct {    
  1344. X    char *expbuf;        /* The compiled search string */
  1345. X    int eblen;            /* Length of above buffer */
  1346. X    char *alternatives[NALTS];    /* The list of \| seperated alternatives */
  1347. X    char *braslist[NBRA];    /* RE meta-bracket start list */
  1348. X    char *braelist[NBRA];    /* RE meta-bracket end list */
  1349. X    char *brastr;        /* saved match string after execute() */
  1350. X    char nbra;            /* The number of meta-brackets int the most
  1351. X                   recenlty compiled RE */
  1352. X    bool do_folding;        /* fold upper and lower case? */
  1353. X} COMPEX;
  1354. X
  1355. Xvoid    search_init ANSI((void));
  1356. Xvoid    init_compex ANSI((COMPEX *));
  1357. Xvoid    free_compex ANSI((COMPEX *));
  1358. Xchar    *getbracket ANSI((COMPEX *,int));
  1359. Xvoid    case_fold ANSI((int));
  1360. Xchar    *compile ANSI((COMPEX *,char *,int,int)); 
  1361. Xvoid    grow_eb ANSI((COMPEX *));
  1362. Xchar    *execute ANSI((COMPEX *,char *)); 
  1363. Xbool    advance ANSI((COMPEX *,char *,char *));
  1364. Xbool    backref ANSI((COMPEX *,int,char *)); 
  1365. Xbool    cclass ANSI((char *,int,int));
  1366. X#endif
  1367. END_OF_FILE
  1368.   if test 1354 -ne `wc -c <'search.h'`; then
  1369.     echo shar: \"'search.h'\" unpacked with wrong size!
  1370.   fi
  1371.   # end of 'search.h'
  1372. fi
  1373. if test -f 'sw.h' -a "${1}" != "-c" ; then 
  1374.   echo shar: Will not clobber existing file \"'sw.h'\"
  1375. else
  1376.   echo shar: Extracting \"'sw.h'\" \(513 characters\)
  1377.   sed "s/^X//" >'sw.h' <<'END_OF_FILE'
  1378. X/* $Header: sw.h,v 4.3.3.1 91/01/16 03:37:39 davison Trn $
  1379. X *
  1380. X * $Log:    sw.h,v $
  1381. X * Revision 4.3.3.1  91/01/16  03:37:39  davison
  1382. X * Added optional prototyping.
  1383. X * 
  1384. X * Revision 4.3  85/05/01  11:51:07  lwall
  1385. X * Baseline for release with 4.3bsd.
  1386. X * 
  1387. X */
  1388. X
  1389. X#ifdef INNERSEARCH
  1390. XEXT int gline INIT(0);
  1391. X#endif
  1392. X
  1393. Xvoid    sw_init ANSI((int,char **,char **));
  1394. Xvoid    sw_file ANSI((char **,bool));
  1395. Xvoid    sw_list ANSI((char *));
  1396. Xvoid    decode_switch ANSI((char *));
  1397. Xvoid    pr_switches ANSI((void));
  1398. Xvoid    cwd_check ANSI((void));
  1399. END_OF_FILE
  1400.   if test 513 -ne `wc -c <'sw.h'`; then
  1401.     echo shar: \"'sw.h'\" unpacked with wrong size!
  1402.   fi
  1403.   # end of 'sw.h'
  1404. fi
  1405. if test -f 'unipatch.c' -a "${1}" != "-c" ; then 
  1406.   echo shar: Will not clobber existing file \"'unipatch.c'\"
  1407. else
  1408.   echo shar: Extracting \"'unipatch.c'\" \(1338 characters\)
  1409.   sed "s/^X//" >'unipatch.c' <<'END_OF_FILE'
  1410. X/*
  1411. XA filter to turn a unidiff into a degenerate context diff (no '!'s)
  1412. Xfor patch. Author: davison@borland.com
  1413. X*/
  1414. X#include <stdio.h>
  1415. X#define ERR(a) {fputs(a,stderr);exit(1);}
  1416. Xstruct Ln {
  1417. X    struct Ln *lk;
  1418. X    char t;
  1419. X    char s[1];
  1420. X} r,*h,*ln;
  1421. Xchar *malloc();
  1422. Xmain()
  1423. X{
  1424. Xchar bf[2048],*cp,ch;
  1425. Xlong os,ol,ns,nl,ne,lncnt=0;
  1426. Xfor(;;){
  1427. X for(;;){
  1428. X    if(!fgets(bf,sizeof bf,stdin)) exit(0);
  1429. X    lncnt++;
  1430. X    if(!strncmp(bf,"@@ -",4)) break;
  1431. X    fputs(bf,stdout);
  1432. X }
  1433. X if(sscanf(bf+4,"%ld,%ld +%ld,%ld %c",&os,&ol,&ns,&nl,&ch)!=5||ch!='@')
  1434. X    goto bad;
  1435. X r.lk=0, h= &r, ne=ns+nl-1;
  1436. X printf("***************\n*** %ld,%ld ****\n",os,os+ol-(os>0));
  1437. X while(ol||nl){
  1438. X    if(!fgets(bf,sizeof bf,stdin)){
  1439. X        if(nl>2) ERR("Unexpected end of file.\n");
  1440. X        strcpy(bf," \n");
  1441. X    }
  1442. X    lncnt++;
  1443. X    if(*bf=='\t'||*bf=='\n')
  1444. X        ch=' ', cp=bf;
  1445. X    else
  1446. X        ch= *bf, cp=bf+1;
  1447. X    switch(ch){
  1448. X    case'-':if(!ol--) goto bad;
  1449. X        printf("- %s",cp);
  1450. X        break;
  1451. X    case'=':ch=' ';
  1452. X    case' ':if(!ol--) goto bad;
  1453. X        printf("  %s",cp);
  1454. X    case'+':if(!nl--) goto bad;
  1455. X        ln = (struct Ln*)malloc(sizeof(*ln)+strlen(cp));
  1456. X        if(!ln) ERR("Out of memory!\n");
  1457. X        ln->lk=0, ln->t=ch, strcpy(ln->s,cp);
  1458. X        h->lk=ln, h=ln;
  1459. X        break;
  1460. X    default:
  1461. X    bad:    fprintf(stderr,"Malformed unidiff at line %ld: ",lncnt);
  1462. X        ERR(bf);
  1463. X    }
  1464. X }
  1465. X printf("--- %ld,%ld ----\n",ns,ne);
  1466. X for(ln=r.lk;ln;ln=h){
  1467. X    printf("%c %s",ln->t,ln->s);
  1468. X    h=ln->lk;
  1469. X    free(ln);
  1470. X }
  1471. X}
  1472. X}
  1473. END_OF_FILE
  1474.   if test 1338 -ne `wc -c <'unipatch.c'`; then
  1475.     echo shar: \"'unipatch.c'\" unpacked with wrong size!
  1476.   fi
  1477.   # end of 'unipatch.c'
  1478. fi
  1479. if test -f 'util.h' -a "${1}" != "-c" ; then 
  1480.   echo shar: Will not clobber existing file \"'util.h'\"
  1481. else
  1482.   echo shar: Extracting \"'util.h'\" \(1259 characters\)
  1483.   sed "s/^X//" >'util.h' <<'END_OF_FILE'
  1484. X/* $Header: util.h,v 4.3.3.1 91/01/16 03:41:51 davison Trn $
  1485. X *
  1486. X * $Log:    util.h,v $
  1487. X * Revision 4.3.3.1  91/01/16  03:41:51  davison
  1488. X * Added optional prototyping.
  1489. X * 
  1490. X * Revision 4.3  85/05/01  11:51:58  lwall
  1491. X * Baseline for release with 4.3bsd.
  1492. X * 
  1493. X */
  1494. X
  1495. XEXT bool waiting INIT(FALSE);        /* are we waiting for subprocess (in doshell)? */
  1496. XEXT int len_last_line_got INIT(0);
  1497. X            /* strlen of some_buf after */
  1498. X            /*  some_buf = get_a_line(bufptr,buffersize,fp) */
  1499. X
  1500. X/* is the string for makedir a directory name or a filename? */
  1501. X
  1502. X#define MD_DIR 0
  1503. X#define MD_FILE 1
  1504. X
  1505. Xvoid    util_init ANSI((void));
  1506. Xint    doshell ANSI((char *,char *));
  1507. Xchar    *safemalloc ANSI((MEM_SIZE));
  1508. Xchar    *saferealloc ANSI((char *,MEM_SIZE));
  1509. Xchar    *safecpy ANSI((char *,char *,int));
  1510. Xchar    *safecat ANSI((char *,char *,int));
  1511. Xchar    *cpytill ANSI((char *,char *,int));
  1512. Xchar    *instr ANSI((char *,char *));
  1513. X#ifdef SETUIDGID
  1514. X    int        eaccess ANSI((char *,int));
  1515. X#endif
  1516. Xchar    *getwd ANSI((char *));
  1517. Xchar    *get_a_line ANSI((char *,int,FILE *));
  1518. Xchar    *savestr ANSI((char *));
  1519. Xint    makedir ANSI((char *,int));
  1520. Xvoid    setenv ANSI((char *,char *));
  1521. Xint    envix ANSI((char *));
  1522. Xvoid    notincl ANSI((char *));
  1523. Xchar    *getval ANSI((char *,char *));
  1524. Xvoid    growstr ANSI((char **,int *,int));
  1525. Xvoid    setdef ANSI((char *,char *));
  1526. END_OF_FILE
  1527.   if test 1259 -ne `wc -c <'util.h'`; then
  1528.     echo shar: \"'util.h'\" unpacked with wrong size!
  1529.   fi
  1530.   # end of 'util.h'
  1531. fi
  1532. echo shar: End of archive 14 \(of 14\).
  1533. cp /dev/null ark14isdone
  1534. MISSING=""
  1535. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
  1536.     if test ! -f ark${I}isdone ; then
  1537.     MISSING="${MISSING} ${I}"
  1538.     fi
  1539. done
  1540. if test "${MISSING}" = "" ; then
  1541.     echo You have unpacked all 14 archives.
  1542.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1543. else
  1544.     echo You still must unpack the following archives:
  1545.     echo "        " ${MISSING}
  1546. fi
  1547. exit 0
  1548.